package cn.ydt.ydt.pojo.shopping.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@Document(indexName = "ydt_vegetable_index")
@ApiModel(value="对应搜索的文档entity")
public class VegetableElastic implements Serializable {

    /**
     * 记录id
     */
    @Id
    @ApiModelProperty(value="vegetableId")
    private String vegetableId;

    @Field(name = "vegetableName",type = FieldType.Text,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品名")
    private String vegetableName;

    /**
     * 种类
     */

    @Field(name = "vegetableSort",type = FieldType.Text,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品种类")
    private String vegetableSort;

    /**
     * 图片
     */
    @Field(name = "vegetableImage",type = FieldType.Text,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品图片")
    private String vegetableImage;

    /**
     * 价格
     */
    @Field(name = "vegetablePrice",type = FieldType.Double,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品价格")
    private Double vegetablePrice;

    /**
     * 最大购买量
     */
    @Field(name = "vegetableMax",type = FieldType.Integer,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品最大购买量")
    private Integer vegetableMax;

    /**
     * 库存
     */
    @Field(name = "vegetableStock",type = FieldType.Integer,
            analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value = "菜品库存")
    private Integer vegetableStock;
}
